package kcms.db;

// Generated Sep 18, 2015 4:49:32 PM by Hibernate Tools 4.0.0

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

import org.springframework.stereotype.Component;

/**
 * Assignment generated by hbm2java
 */
@Component
@Entity
@Table(name = "assignment", catalog = "kcms", uniqueConstraints = @UniqueConstraint(columnNames = {
		"cid", "csn", "assignmentname" }))
public class Assignment implements java.io.Serializable {

	private Integer assignmentsn;
	private String cid;
	private String csn;
	private String assignmentname;
	private String description;
	private Date duetime;

	public Assignment() {
	}

	public Assignment(String cid, String csn, String assignmentname,
			String description, Date duetime) {
		this.cid = cid;
		this.csn = csn;
		this.assignmentname = assignmentname;
		this.description = description;
		this.duetime = duetime;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "assignmentsn", unique = true, nullable = false)
	public Integer getAssignmentsn() {
		return this.assignmentsn;
	}

	public void setAssignmentsn(Integer assignmentsn) {
		this.assignmentsn = assignmentsn;
	}

	@Column(name = "cid", nullable = false, length = 50)
	public String getCid() {
		return this.cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}

	@Column(name = "csn", nullable = false, length = 50)
	public String getCsn() {
		return this.csn;
	}

	public void setCsn(String csn) {
		this.csn = csn;
	}

	@Column(name = "assignmentname", nullable = false, length = 50)
	public String getAssignmentname() {
		return this.assignmentname;
	}

	public void setAssignmentname(String assignmentname) {
		this.assignmentname = assignmentname;
	}

	@Column(name = "description", nullable = false)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "duetime", nullable = false, length = 19)
	public Date getDuetime() {
		return this.duetime;
	}

	public void setDuetime(String duetime) throws ParseException {
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
		this.duetime = sdf.parse(duetime);
	}
	
	public void setDuetime(Date duetime) {
		this.duetime = duetime;
	}
	
	

}
